﻿<%@page contentType="text/vnd.wap.wml; charset=utf-8"%>
<%@ page import="java.io.*"%>
<%@ page import="java.sql.*"%>
<%@ page import="java.util.*"%>
<%@ page import="java.text.*"%>
<%@ page import="common.*"%>
<%@ page import="wapbean.*"%>

<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.1//EN" "http://www.wapforum.org//DTD//wml_1.1.xml">   
<wml>
<%     // String Pro=(String)session.getAttribute("ProviderID");  
       // System.out.println("ProProProPro="+Pro); 
        String name=(String)session.getAttribute("name"); 
        String Byname=(String)session.getAttribute("Byname");  
    	String purl = (String) session.getAttribute("p");
        ContentFactory Fac= new ContentFactory();
        Map map1=new HashMap();  
    	Map map2=new HashMap();
	    Vector ver = new Vector();   
	    Vector ver1 = new Vector(); 
	    WapcategoryFactory Fac1 = new WapcategoryFactory();  
	    SecondUrl second=new SecondUrl();
	    map1=second.getvauleTitle(purl);
         
        Vector vc = Fac.getMobilemodelBean();    
      boolean find = false;
       String MobileName=null;
	if (vc != null && !vc.isEmpty()) {
		int n = vc.size();
	//	System.out.println("nnnnnn=" + n);
		//循环获取url
		//String prid=null;
		for (int j = 1; j < n; j++) {
			MobilemodelBean ab = (MobilemodelBean) vc.elementAt(j);
			String description = ab.getDescription();
			  MobileName=ab.getMobileName();
			//prid = ab.getProviderID();
			
			String[] p = description.split(";");
		//	System.out.println("pppppp=" + p);
			int k;
			//判断当前机型是否包含访问中带的机型----------------begin
				for ( k = 0; k < p.length; k++) { 
					if (purl.equals(p[k])) { 
						find = true;
		    	//System.out.println("获取到url=" + purl);
					  break;   
					}
				}
			//判断当前机型是否包含访问中带的机型----------------end
			if(find){
				break;  
			}

	   }
	   // System.out.println("MobileName=" + MobileName); 
	   //for 循环结束
	   
	   //-------------------------------begin
	   				
			//判断当前url是否与访问url相等----------------begin
			//判断是否获取到对应url--------------begin 
			if(!find){//没找到
			//如果没有找到对应机型，但是url又不为空，则跳转到雅维28
				  purl="yw28";  
		          map1=second.getvauleTitle(purl);  
			//	 System.out.println("pgggggggggggggggggggggggggggggggggggg=" + find);
			}else{//找到了对应的机型，如果没有内容，则跳转到维护页面
				if(map1 == null || map1.isEmpty()){
		       //  session.setAttribute("prid",prid); 
		       //  System.out.println("pridfffffffff=*===="+prid); 
				%>
	    		 <jsp:forward page="wappages/anc.jsp"></jsp:forward>
	    		<% 
	    		 }else{
	    			 map1=second.getvauleTitle(purl);       
	    		 }  
			}
		}
	   //----------------------------------end    
	      
	      //    map1=second.getvauleTitle(purl);    
	          System.out.println("<------game3.0------>");
	          System.out.println("purl===="+purl);
	          System.out.println("<------game3.0------>");
	          String mobileModelId=null;
	          String ProviderID=null;
	          String CategoryID=null;
	          Allbean  bean1=null;
	           for (Iterator iter1 = map1.keySet().iterator(); iter1.hasNext();) {
	              String  element1 = (String)iter1.next();
	    		  bean1=(Allbean)map1.get(element1);
    			  String Eva_CategoryID=bean1.getEva_CategoryID();
    			   CategoryID=bean1.getCategoryID();
    			  mobileModelId=bean1.getMobileModelID();
    			  ProviderID=bean1.getProviderID();
    			
    			
    			
	    	     }
	    	   
	    	     ProviderBean pb=Fac.getProvider(ProviderID);
	    	    
	    	     
	%> 
<card id="card1" title="乐游-<%=pb.getName()%>专区">          
<p align="left">

 <img src="/game3.0/img/logo.png" alt=""/>  
	<br />
	<%if(MobileName.equals("28")){    
	//System.out.println("MobileName=*===="+MobileName);
	%>
	<a href="http://wap.leyoou.cn/game3.0/StoryServlet1?CategoryID=000&amp;mobileModelId=<%=mobileModelId%>&amp;purl=<%=purl%>&amp;MobileName=<%=MobileName%>"> 卓阅电子书 </a><br/> 
	<!--  <a href="http://wap.leyoou.cn/game2.0/resources/10/28/zuoyue_28_v1.0.0.jad"> 卓阅电子书 </a><br/>--> 
	<% }else if(MobileName.equals("25")||MobileName.equals("k25")){%>
	   <a href="http://wap.leyoou.cn/game3.0/StoryServlet1?CategoryID=000&amp;mobileModelId=<%=mobileModelId%>&amp;purl=<%=purl%>&amp;MobileName=<%=MobileName%>"> 卓阅电子书 </a><br/> 
	  <!-- <a href="http://wap.leyoou.cn/game2.0/resources/10/25/zuoyue_25_v1.0.0.jad"> 卓阅电子书 </a><br/> -->  
	 <% }             
	            Vector ver7 = Fac1.getMobileModelIdWapcategory(mobileModelId);
	           //    System.out.println("mobileModelId=*===="+mobileModelId);
   	                   if(ver7!=null){  
                       int r=ver7.size();   
                   for(int q=0;q<r;q++){
                   Allbean bea7=(Allbean)ver7.elementAt(q);   
         %>   
         <!-- <a href="<%=bea7.getActionPage()%>phone=<%=purl%>&amp;pid=3"> <%out.print(bea7.getTitle());%> </a><br/>-->  
          <a href="http://wap.leyoou.cn/game3.0/WapcategoryServlet?CategoryID=<%=bea7.getCategoryID()%>&amp;mobileModelId=<%=mobileModelId%>&amp;purl=<%=purl%>&amp;ActionPage=<%=bea7.getActionPage()%>"><%out.print(bea7.getTitle());%></a> <br/>  
           <!-- <a href="http://localhost:8080/game3.0/WapcategoryServlet?CategoryID=<%=bea7.getCategoryID()%>&amp;mobileModelId=<%=mobileModelId%>&amp;purl=<%=purl%>&amp;ActionPage=<%=bea7.getActionPage()%>"><%out.print(bea7.getTitle());%></a> <br/> -->                   
          <%         }}  
	    	   //  System.out.println("mobileModelId=*===="+mobileModelId);
	    	     ver1 = second.getvaules3(mobileModelId); 
	    	     if (ver1 != null && !ver1.isEmpty()) {  
 		          int m = ver1.size();
 		         //  System.out.println("ver1===="+ver1.size());
 		            for (int i = 0; i < m; i++) {
 		            Allbean allbea = (Allbean) ver1.elementAt(i);
 		          //    System.out.println("allbea===="+allbea.getCategoryID());
 		            Object obj = map1.get(allbea.getCategoryID());
 		            if(obj!=null&&!ver1.isEmpty()){
 		           %>
 		           <%
 		            if(((Allbean)obj).getCategoryTypeID().equals("2")){
 		          //  System.out.println("title===="+((Allbean)obj).getTitle());
 		             %>
 		            <%if(allbea.getCategoryID().equals("39")){//如果不是彩铃专栏，则显示栏目  
 		             %> 
 		     <%out.println(((Allbean)obj).getTitle());%><br/>
 		    本栏目所有彩铃内容暂只支持使用中国移动手机号码下载，请您谅解!!!<br/>
 		     <%} 
 		     else{ %>
 		     <%out.println(((Allbean)obj).getTitle());%><br/>
 		   <%} %>
           <% 
 		            Vector ver5 = second.getWapcategoryMobilemodelvaules(((Allbean)obj).getCategoryID(),mobileModelId,ProviderID);
 		            
		            if(ver5!=null){
                    int g=ver5.size(); 
                    
                    for(int s=0;s<g;s++){
                    Allbean bea5=(Allbean)ver5.elementAt(s);    
                    %>
                    <%//out.println(bea5.getCategoryID()+"----"+bea5.getActionPage().indexOf("211.137.86.73"));%>
                    <%
                   if(bea5.getActionPage().indexOf("211.137.86.73")<0){ //如果检索不到彩铃地址，则执行默认程序
                   if(s<g-1){
                   %>
                    <a href="/game3.0/wappages/gameList.jsp?CategoryID=<%=bea5.getCategoryID()%>&amp;MobileModelID=<%=bea5.getMobileModelID()%>&amp;ProviderID=<%=bea5.getProviderID()%>&amp;purl=<%=purl%>"><%out.println(bea5.getTitle());%> </a>|
                   <%
                  }else{
                   %>
                    <a href="/game3.0/wappages/gameList.jsp?CategoryID=<%=bea5.getCategoryID()%>&amp;MobileModelID=<%=bea5.getMobileModelID()%>&amp;ProviderID=<%=bea5.getProviderID()%>&amp;purl=<%=purl%>"><%out.println(bea5.getTitle());%> </a>
                   <%
                  }
                  }else{//如果是彩铃地址，则独立处理
                 %> 
                 *<a href="<%=bea5.getActionPage()%>m=game3.0/<%=purl%>"><%out.println(bea5.getTitle());%></a>
                 <% }
                  // if(s==ver5.size()-1){
                  //   out.println("<br/>");    
                  //    }
                     }
                     
                     }
                     }else if(((Allbean)obj).getCategoryTypeID().equals("14")){
 		            Vector ver5 = second.getWapcategoryMobilemodelvaules(((Allbean)obj).getCategoryID(),mobileModelId,ProviderID);
		            if(ver5!=null){
                    int g=ver5.size(); 
              
                    for(int s=0;s<g;s++){
                    Allbean bea5=(Allbean)ver5.elementAt(s);    
                    
                   if(s<g-1){
                   %>
                    <a href="/game3.0/wappages/gameList.jsp?CategoryID=<%=bea5.getCategoryID()%>&amp;MobileModelID=<%=bea5.getMobileModelID()%>&amp;ProviderID=<%=bea5.getProviderID()%>&amp;purl=<%=purl%>"><%out.println(bea5.getTitle());%> </a>*
                   <%
                  }else{
                   %>
                    <a href="/game3.0/wappages/gameList.jsp?CategoryID=<%=bea5.getCategoryID()%>&amp;MobileModelID=<%=bea5.getMobileModelID()%>&amp;ProviderID=<%=bea5.getProviderID()%>&amp;purl=<%=purl%>"><%out.println(bea5.getTitle());%> </a>
                   <%
                  } //if(s==ver5.size()-1){
                    // out.println("<br/>");    
                    //  }
                     }
                     }
                     }else if(((Allbean)obj).getCategoryTypeID().equals("15")){
 		            Vector ver5 = second.getWapcategoryMobilemodelvaules(((Allbean)obj).getCategoryID(),mobileModelId,ProviderID);
		            if(ver5!=null){
                    int g=ver5.size(); 
              
                    for(int s=0;s<g;s++){
                    Allbean bea5=(Allbean)ver5.elementAt(s);    
                    
                   if(s<g-1){
                   %>
                    <a href="/game3.0/wappages/gameList.jsp?CategoryID=<%=bea5.getCategoryID()%>&amp;MobileModelID=<%=bea5.getMobileModelID()%>&amp;ProviderID=<%=bea5.getProviderID()%>&amp;purl=<%=purl%>"><%out.println(bea5.getTitle());%> </a>.
                   <%
                  }else{
                   %>
                    <a href="/game3.0/wappages/gameList.jsp?CategoryID=<%=bea5.getCategoryID()%>&amp;MobileModelID=<%=bea5.getMobileModelID()%>&amp;ProviderID=<%=bea5.getProviderID()%>&amp;purl=<%=purl%>"><%out.println(bea5.getTitle());%> </a>
                   <%
                  } //if(s==ver5.size()-1){
                    // out.println("<br/>");    
                    //  }
                     }
                     }
                     }else if (((Allbean)obj).getCategoryTypeID().equals("5")) {   
 %> <a href="<%=((Allbean)obj).getActionPage()%>"> <% out.println(((Allbean)obj).getTitle()); %> </a> <%
 		
 		}   else if (((Allbean)obj).getCategoryTypeID().equals("12")) {
 %> <a href="/game3.0/wappages/gameList.jsp?CategoryID=<%=((Allbean)obj).getCategoryID()%>&amp;MobileModelID=<%=mobileModelId%>&amp;ProviderID=<%=ProviderID%>&amp;purl=<%=purl%>">
		<%out.println(((Allbean)obj).getTitle());%> </a> 
		<%
             }
                     else{
                     out.println(((Allbean)obj).getTitle());%>
                     <%} %><br /> 
                     
                <%            
	                 Vector ver4;
   	               if(((Allbean)obj).getCategoryTypeID().equals("1")){
   	               Vector ver6 = Fac1.getWapcategory(((Allbean)obj).getCategoryID());
   	                   if(ver6!=null){
                       int h=ver6.size(); 
                   for(int t=0;t<h;t++){
                   Allbean bea6=(Allbean)ver6.elementAt(t);    
                   %>
                  <% if((bea6.getCategoryID().equals("29")||bea6.getCategoryID().equals("30"))&&(purl.equals("oppom200")||purl.equals("oppo07002")||purl.equals("oppo08008"))){
                     
                     }else{%>
                   <!-- <a href="<%=bea6.getActionPage()%>phone=<%=purl%>&amp;pid=3"> <%out.print(bea6.getTitle());%> </a><br/>-->
                     <a href="http://wap.leyoou.cn/game3.0/WapcategoryServlet?CategoryID=<%=bea6.getCategoryID()%>&amp;mobileModelId=<%=mobileModelId%>&amp;purl=<%=purl%>&amp;ActionPage=<%=bea6.getActionPage()%>&amp;m=<%=purl%>"><%//out.print(bea6.getTitle());%></a> <br/>
                   <%}}}  
					ver4 = second.getMobilemodelContentvaules(((Allbean)obj).getCategoryID(),mobileModelId,ProviderID);
   	                if(ver4!=null){
                    int a=ver4.size(); 
              
                    for(int t=0;t<a;t++){
                    Allbean bea4=(Allbean)ver4.elementAt(t);  
                   
            	 %> 
 
		 <a href="/game3.0/wappages/contentgameview.jsp?CategoryID=<%=bea4.getCategoryID()%>&amp;MobileModelID=<%=bea4.getMobileModelID()%>&amp;ProviderID=<%=bea4.getProviderID()%>&amp;contentId=<%=bea4.getContentId()%>&amp;purl=<%=purl%>&amp;ContentResourceID=<%=bea4.getContentResourceID()%>&amp;cpId=<%=bea4.getCpId()%>&amp;submitCode=<%=bea4.getSubmitCode()%>"><%
 out.println(bea4.getTitle());    
 %>
</a> <br />     
                     
                       
 		           <%}}}}}}%>      
	   
	 <!-- <a href="/game3.0/wappages/mobilemodelname.jsp?ProviderID=<%//=Pro%>&amp;Name=<%=name%>&amp;Byname=<%=Byname%>">返回</a><br /> -->  
	  <a href="wappages/deraign1.jsp?purl=<%=purl%>">游戏问题解决专栏</a><br />      	
	【<a href="wappages/helpgame.jsp?purl=<%=purl%>">客服咨询</a>】      
	<br />  						 	    
	wap.leyoou.cn    
	

	</p>
</card>
</wml>